package org.example.jdk8.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class test5 {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("hello welcome", "world hello", "hello world","hello world hello","hello welcome");

        list.stream().map(s->s.split(" ")).flatMap(Arrays::stream).distinct().forEach(System.out::println);
    }
}
